package com.vf.admin.client.service.impl;

import com.vf.admin.client.dao.*;
import com.vf.admin.client.service.AppAuthService;
import com.vf.admin.common.splitpage.SplitPageBean;
import com.vf.admin.miaodong.entity.AppAuth;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class AppAuthServiceImpl implements AppAuthService {

    @Autowired
    AppAuthDao appAuthDao;

    public List<AppAuth> list() {
        return appAuthDao.list();
    }

    @Override
    public List<AppAuth> page(Map<String, Object> paraMap, SplitPageBean splitPage) {
        return appAuthDao.page(paraMap, splitPage);
    }

    @Override
    public AppAuth get(Integer id) {
        return appAuthDao.get(id, AppAuth.class);
    }

    @Override
    public void del(Integer id) {
        appAuthDao.del(id);
    }

    @Override
    public void save(AppAuth appAuth) {
        if (appAuth.getId() != null && appAuth.getId() > 0) {
            appAuthDao.update(appAuth);
        } else {
            appAuthDao.add(appAuth);
        }
    }
}
